package com.bianguo.android.iocdemo.utils;

import com.bianguo.android.iocdemo.interfaces.IImageProcessor;

public class ImageLoadHelper {

    private static volatile ImageLoadHelper instance;
    private static IImageProcessor processor;

    private ImageLoadHelper() {
    }

    public static ImageLoadHelper getInstance() {
        ImageLoadHelper helper = instance;
        if (helper == null) {
            synchronized (ImageLoadHelper.class) {
                if (helper == null) {
                    helper = new ImageLoadHelper();
                    instance = helper;
                }
            }
        }
        return helper;
    }

    public static void init(IImageProcessor imageProcessor) {
        processor = imageProcessor;
    }

    public void imageLoader(String imageUrl) {
        processor.loadImage(imageUrl);
    }
}
